package com.baizhi.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Admin {
/*    CREATE TABLE `ums_admin` (
            `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `icon` varchar(500) DEFAULT NULL COMMENT '头像',
            `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
            `nick_name` varchar(200) DEFAULT NULL COMMENT '昵称',
            `note` varchar(500) DEFAULT NULL COMMENT '备注信息',
            `create_time` datetime DEFAULT NULL COMMENT '创建时间',
            `login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
            `status` int(1) DEFAULT '1' COMMENT '帐号启用状态：0->禁用；1->启用',
    PRIMARY KEY (`id`)
)*/
    private Integer id;
    private String username;
    private String password;
    private String icon;
    private String email;
    private String nick_name;
    private String note;
    @DateTimeFormat(pattern = "yyyy-MM-dd") //接收日期的格式
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss") //响应json的日期格式
    private Date create_time;
    @DateTimeFormat(pattern = "yyyy-MM-dd") //接收日期的格式
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss") //响应json的日期格式
    private Date login_time;
    private Integer status;
}
